package com.dq.Week3.day12.linkedList.homework;

import com.dq.Week3.day12.list.ArtShow;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class TextEditorUtils {
    public static void main(String[] args) throws FileNotFoundException {
        List<String> list = TextEditorUtils.creatList();
        for (String s : list) {
            System.out.println(s);
        }
    }
    public static List<String> creatList() throws FileNotFoundException {
        ArrayList<String> strings = new ArrayList<>();


        String filepath = "D:\\artshow.txt";
        File file = new File(filepath);
        Scanner scanner = new Scanner(file);
        while (scanner.hasNext())
        {
            String line = scanner.nextLine();

            String s = createArtShow(line);
            strings.add(s);
        }
        scanner.close();

        return strings;
    }
    private static String createArtShow(String line) {
        String s = "\t";
        String[] split = line.split(s);
        return new String(split[0]+split[1]+split[2]+split[3]);

    }
}
